<template>
    <RouterView></RouterView>
</template>
<script lang="ts" setup>
import { ref, reactive, provide,onMounted } from 'vue';
import { RouterView } from 'vue-router';
const isLoggedIn = ref(false)
const setLoggedIn = (value :boolean)=>{
    isLoggedIn.value = value
    localStorage.setItem('isLoggedIn',value.toString())
}
provide('isLoggedIn',isLoggedIn)
provide('setLoggedIn',setLoggedIn)
onMounted(()=>{
    const storedIsLoggedIn = localStorage.getItem('isLoggedIn')
    if (storedIsLoggedIn){
        isLoggedIn.value = storedIsLoggedIn == 'true'
    }
})
</script>
<style scoped>
</style>